package com.errorfinding.tabbitmqDemo.consumer;

import com.errorfinding.tabbitmqDemo.config.ConfirmConfig;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 消费者 报警
 */
@Component
public class WarmingConsumer {
    //接收报警消息
    @RabbitListener(queues = ConfirmConfig.warning_queue_name)
    public void receiveWarningMsg(Message message){
        String msg = new String(message.getBody());
        System.out.println("报警发现不可路由消息："+msg);
    }
}
